﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.Remoting.Metadata.W3cXsd2001;
using System.Text;
using System.Threading.Tasks;

namespace 属性
{
    class Program
    {
        static void Main(string[] args)
        {
            Student stu = new Student();
            stu.Name = "张三";
            stu.Age = 23;
            stu.Addr = "广州";

            Console.WriteLine("{0},{1},{2}",stu.Name,stu.Age,stu.Addr);

            Console.ReadKey();
        }
    }

    public class Student
    {
        // 默认就是private
        String _name;
        int _age;
        String _address;

        public String Name
        {
            get
            {
                return _name;
            }
            set { _name = value; }
        }

        public int Age
        {
            get 
            {
                return _age;
            }
            set
            {
                _age = value;
            }
        }

        public string Addr
        {
            get
            {
                return _address;
            }
            set
            {
                _address = value;
            }
        }



    }
}
